495A - Digital Counter - CodeForces Solution


implementation *1100

Please click on ads to support us..

Python Code:

d={0:2,1:7,2:2,3:3,4:3,5:4,6:2,7:5,8:1,9:2}
s=input().rstrip()
print(d[int(s[0])]*d[int(s[1])])

C++ Code:

#include <bits/stdc++.h>
 
using namespace std;

int main()
{
    int n,n1,n2,s1,s2;
    cin>>n;
    n1=n%10;
    n2=n/10;

   if (n1==0 || n1== 2 || n1==6 || n1==9){s1=2;}
   else if(n1==1 ){s1=7;}
   else if(n1==3 || n1==4){s1=3;}
   else if(n1==5){s1=4;}
   else if(n1==7){s1=5;}
   else if(n1==8){s1=1;}

  if (n2==0 || n2== 2 || n2==6 || n2==9){s2=2;}
   else if(n2==1 ){s2=7;}
   else if(n2==3 || n2==4){s2=3;}
   else if(n2==5){s2=4;}
   else if(n2==7){s2=5;}
   else if(n2==8){s2=1;}


   cout<< s1*s2 <<endl;

    return 0;
}


Comments

Submit
0 Comments
More Questions

892B - Wrath
999A - Mishka and Contest
727C - Guess the Array
1625C - Road Optimization
1715D - 2+ doors
267A - Subtractions
1582A - Luntik and Concerts
560A - Currency System in Geraldion
946A - Partition
1068B - LCM
1692E - Binary Deque
679A - Bear and Prime 100
488A - Giga Tower
14A - Letter
1150A - Stock Arbitraging
1552A - Subsequence Permutation
1131F - Asya And Kittens
1475F - Unusual Matrix
133B - Unary
1547A - Shortest Path with Obstacle
624A - Save Luke
1238A - Prime Subtraction
1107C - Brutality
1391B - Fix You
988B - Substrings Sort
312A - Whose sentence is it
513A - Game
1711E - XOR Triangle
688A - Opponents
20C - Dijkstra